/*
 * @Author: qiulin_JXGM ql1746365080@gmail.com
 * @Date: 2024-09-02 14:36:56
 * @LastEditors: qiulin_JXGM ql1746365080@gmail.com
 * @LastEditTime: 2024-09-02 16:44:27
 * @FilePath: \SGFEM\DataStructure\FEM\Property\include\PBEAMLData.h
 */

#pragma once
#include <cstring>
#include <string>
#include <vector>

#include "DataStructure/Common/DataStructureNamespace.h"
#include "DataStructure/Common/Id.h"
#include "DataStructure/Common/Real.h"
#include "DataStructure/Input/Property/PropertyBase.h"

#include "BeamSectionStandardTypes.h"

SG_DATASTRUCTURE_FEM_NAMESPACE_OPEN
/** @brief 标准梁截面
 *
 * 预定义的截面形状。通过 \ref BeamSectionTypes "梁截面（形状）标准类型"和对应的几何尺寸定义截面形状
 */
struct DECLSPEC PBEAMLData : public PropertyBase
{
    struct section
    {
        SG::DataStructure::Common::Real              m_so    = 0.0;  ///< 应力输出请求选项
        SG::DataStructure::Common::Real              m_rdist = 0.0;  ///< 在单元坐标系中到端点A的距离除以单元的长度
        SG::DataStructure::Common::Real              m_nsm   = 0.0;  ///< 非结构质量
        std::vector<SG::DataStructure::Common::Real> m_dims;         ///< 截面参数
    };

    SG::DataStructure::Common::Id m_mId      = 0;                    ///< 材料属性Id
    char                          m_group[8] = { 0 };                ///< 截面名称
    char                          m_type[8]  = { 0 };                ///< 截面类型
    SG::DataStructure::Common::Id m_domainId = 0;
    std::vector<section>          m_section;                         ///< 截面属性

    /// @brief 获取标准梁截面类型
    /// @return
    SG::DataStructure::FEM::BeamSectionStandardTypes GetBeamSectionStandardTypes ();

    /// @brief      设置标准梁截面类型
    /// @param type 类型枚举
    void SetBeamSectionStandardTypes (SG::DataStructure::FEM::BeamSectionStandardTypes type);

    /// @brief 获取名称
    /// @return
    std::string GetGroup ();

    /// @brief  设置名称
    /// @param str
    void SetGroup (const char* str);
};

/// @brief 判断单元数据是否相等
DECLSPEC bool operator== (const PBEAMLData& a, const PBEAMLData& b);

SG_DATASTRUCTURE_FEM_NAMESPACE_CLOSE